
<form class="checkoutform" action="{:U('update')}" method="post">
  <input type="hidden" name="id" value="{$info.id}">
  <div class="form-group">
    <label class="control-label">标题</label>
    <div>
      <input class="form-control" datatype="*" value="{$info.title}" name="title" type="text" placeholder="标题">
    </div>
  </div>
  <div class="form-group">
    <label class="control-label">分类</label>
    <div class="row">
      <div class="col-sm-8" id="categorylistbox">
        <select class="form-control" name="documentcategory_id">
         
         
          
         <volist name="cate_list" id="vo">
          
            <option <eq name="vo['id']" value="$info['documentcategory_id']">selected="selected"</eq> value="{$vo.id}">{:getdeepstr($vo['deep'])}{$vo.title}</option>
            
          </volist>
          
        </select>
      </div>
      <div class="col-sm-4"><a href="##" title="新增文档分类" class="btn btn-success" rel="{:U('Documentcategory/add')}" width="300" id="categorylistboxaddbtn">新增分类</a></div>
    </div>
  </div>
  <div class="form-group dropzone" id="filebox">
    <volist name="info['file']" id="file">
      <div class="preview file-preview processing binddel success"><a class="del" style="position:absolute; bottom:0; right:0; width:26px; height:26px; line-height:26px; text-align:center; background:#f00; color:#fff; font-size:24px;">x</a>
        <div class="details">
          <div class="filename"><span>{$file}</span></div>
          <div class="size"><strong style="font-size:9px;">{:filesize('./Public'.$file)}</strong> 字节</div>
        </div>
        <div class="progress"><span class="upload" style="width: 100%;"></span></div>
        
        <div class="error-message"><span></span></div>
        <input type="hidden" value="{$file}" name="file[]">
      </div>
    </volist>
  </div>
  <iframe src="{:U('uploadfile')}" appendto="#filebox" class="uploadiframe" style="height:150px;" filename="file[]"></iframe>
  
  
</form>
<form action="{:U('Documentcategory/getcategory')}" id="categorylistboxform">
</form>
<script>


$('.documenttype input[name="type"]').change(function(e){
    $('#typelistboxform').attr('');
});


function deldoc(){
	$('#filebox .preview').addClass('binddel');
	$('#filebox .preview.binddel a').click(function(e) {
		
		if(!confirm('确定删除吗？')){
			return false;
		}
		
		$(this).removeClass('binddel');
		var obj = $(this);
        var file = $(this).parent().find('[name="file[]"]').val();
		
		$.get('{:U('delfile')}', {file:file}, function(data){
			if(data.status == 1){
			    obj.parent().remove();
			}else{
				obj.parent().remove();
				alert(data.info);
			}

		}, 'json');
    });
}
deldoc();

$('#filebox').bind('DOMNodeInserted', function(e) {
	//$('#filebox').remove();
deldoc();
		
	});
 
    $('#categorylistbox').ajaxlist({autoload:false});
 </script>